

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import com.zfsoft.util.Tool;

public class HtmlUtils {
	
	public static String toHtml(String str){
		
		str=str.replace("&", "&amp;");
		str=str.replace("\"", "&quot;");
		str=str.replace("<", "&lt;");
		str=str.replace(">", "&gt;");
		str=str.replace(" ", "&nbsp;");
		return str;
		
		
	}
	public static String formHtml(String str){
		str=str.replace("&amp;","&" );
		str=str.replace("&quot;","\"" );
		str=str.replace("&lt;","<" );
		str=str.replace( "&gt;",">");
		str=str.replace("&nbsp;"," " );
		return str;
	}
	/*

--- 	&#127; 	--- 	未使用Unused
¡ 	&#161; 	&iexcl; 	Inverted exclamation
¢ 	&#162; 	&cent; 	货币分标志Cent sign
£ 	&#163; 	&pound; 	英镑标志Pound sterling
¤ 	&#164; 	&curren; 	通用货币标志General currency sign
¥ 	&#165; 	&yen; 	日元标志Yen sign
¦ 	&#166; 	&brvbar; or &brkbar; 	断竖线Broken vertical bar
§ 	&#167; 	&sect; 	分节号Section sign
¨ 	&#168; 	&uml; or &die; 	变音符号Umlaut
© 	&#169; 	&copy; 	版权标志Copyright
ª 	&#170; 	&ordf; 	Feminine ordinal
« 	&#171; 	&laquo; 	Left angle quote, guillemet left
¬ 	&#172; 	&not 	Not sign
­ 	&#173; 	&shy; 	Soft hyphen
® 	&#174; 	&reg; 	注册商标标志Registered trademark
¯ 	&#175; 	&macr; or &hibar; 	长音符号Macron accent
° 	&#176; 	&deg; 	度数标志Degree sign
± 	&#177; 	&plusmn; 	加或减Plus or minus
² 	&#178; 	&sup2; 	上标2 Superscript two
³ 	&#179; 	&sup3; 	上标3 Superscript three
´ 	&#180; 	&acute; 	尖重音符Acute accent
µ 	&#181; 	&micro; 	Micro sign
¶ 	&#182; 	&para; 	Paragraph sign
· 	&#183; 	&middot; 	Middle dot
¸ 	&#184; 	&cedil; 	Cedilla
¹ 	&#185; 	&sup1; 	上标1 Superscript one
º 	&#186; 	&ordm; 	Masculine ordinal
» 	&#187; 	&raquo; 	Right angle quote, guillemet right
¼ 	&#188; 	&frac14; 	四分之一Fraction one-fourth
½ 	&#189; 	&frac12; 	二分之一Fraction one-half
¾ 	&#190; 	&frac34; 	四分之三Fraction three-fourths
¿ 	&#191; 	&iquest; 	Inverted question mark
À 	&#192; 	&Agrave; 	Capital A, grave accent
Á 	&#193; 	&Aacute; 	Capital A, acute accent
Â 	&#194; 	&Acirc; 	Capital A, circumflex
Ã 	&#195; 	&Atilde; 	Capital A, tilde
Ä 	&#196; 	&Auml; 	Capital A, di?esis / umlaut
Å 	&#197; 	&Aring; 	Capital A, ring
Æ 	&#198; 	&AElig; 	Capital AE ligature
Ç 	&#199; 	&Ccedil; 	Capital C, cedilla
È 	&#200; 	&Egrave; 	Capital E, grave accent
É 	&#201; 	&Eacute; 	Capital E, acute accent
Ê 	&#202; 	&Ecirc; 	Capital E, circumflex
Ë 	&#203; 	&Euml; 	Capital E, di?esis / umlaut
Ì 	&#204; 	&Igrave; 	Capital I, grave accent
Í 	&#205; 	&Iacute; 	Capital I, acute accent
Î 	&#206; 	&Icirc; 	Capital I, circumflex
Ï 	&#207; 	&Iuml; 	Capital I, di?esis / umlaut
Ð 	&#208; 	&ETH; 	Capital Eth, Icelandic
Ñ 	&#209; 	&Ntilde; 	Capital N, tilde
Ò 	&#210; 	&Ograve; 	Capital O, grave accent
Ó 	&#211; 	&Oacute; 	Capital O, acute accent
Ô 	&#212; 	&Ocirc; 	Capital O, circumflex
Õ 	&#213; 	&Otilde; 	Capital O, tilde
Ö 	&#214; 	&Ouml; 	Capital O, di?esis / umlaut
× 	&#215; 	&times; 	乘号Multiply sign
Ø 	&#216; 	&Oslash; 	Capital O, slash
Ù 	&#217; 	&Ugrave; 	Capital U, grave accent
Ú 	&#218; 	&Uacute; 	Capital U, acute accent
Û 	&#219; 	&Ucirc; 	Capital U, circumflex
Ü 	&#220; 	&Uuml; 	Capital U, di?esis / umlaut
Ý 	&#221; 	&Yacute; 	Capital Y, acute accent
Þ 	&#222; 	&THORN; 	Capital Thorn, Icelandic
ß 	&#223; 	&szlig; 	Small sharp s, German sz
à 	&#224; 	&agrave; 	Small a, grave accent
á 	&#225; 	&aacute; 	Small a, acute accent
â 	&#226; 	&acirc; 	Small a, circumflex
ã 	&#227; 	&atilde; 	Small a, tilde
ä 	&#228; 	&auml; 	Small a, di?esis / umlaut
å 	&#229; 	&aring; 	Small a, ring
æ 	&#230; 	&aelig; 	Small ae ligature
ç 	&#231; 	&ccedil; 	Small c, cedilla
è 	&#232; 	&egrave; 	Small e, grave accent
é 	&#233; 	&eacute; 	Small e, acute accent
ê 	&#234; 	&ecirc; 	Small e, circumflex
ë 	&#235; 	&euml; 	Small e, di?esis / umlaut
ì 	&#236; 	&igrave; 	Small i, grave accent
í 	&#237; 	&iacute; 	Small i, acute accent
î 	&#238; 	&icirc; 	Small i, circumflex
ï 	&#239; 	&iuml; 	Small i, di?esis / umlaut
ð 	&#240; 	&eth; 	Small eth, Icelandic
ñ 	&#241; 	&ntilde; 	Small n, tilde
ò 	&#242; 	&ograve; 	Small o, grave accent
ó 	&#243; 	&oacute; 	Small o, acute accent
ô 	&#244; 	&ocirc; 	Small o, circumflex
õ 	&#245; 	&otilde; 	Small o, tilde
ö 	&#246; 	&ouml; 	Small o, di?esis / umlaut
÷ 	&#247; 	&divide; 	除号Division sign
ø 	&#248; 	&oslash; 	Small o, slash
ù 	&#249; 	&ugrave; 	Small u, grave accent
ú 	&#250; 	&uacute; 	Small u, acute accent
û 	&#251; 	&ucirc; 	Small u, circumflex
ü 	&#252; 	&uuml; 	Small u, di?esis / umlaut
ý 	&#253; 	&yacute; 	Small y, acute accent
þ 	&#254; 	&thorn; 	Small thorn, Icelandic
ÿ 	&#255; 	&yuml; 	Small y, umlaut
	 */
} 

